<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

Route::group('admin', function() {
    Route::post('login', 'Login/postLogin');
    Route::post('getInfo', 'Login/getInfo');
    Route::post('getDuties', 'Login/getDuties');
    Route::post('changeStatus', 'Login/changeStatus');
    Route::post('store', 'Login/store');
    Route::post('edit', 'Login/edit');
    Route::post('update', 'Login/update');
    Route::post('index', 'Login/index');
    /** 充电桩管理 */
    Route::controller('charge', 'admin/Charging');
    /** 充电桩检测项目 */
    Route::controller('project', 'admin/Project');
    Route::post('userList', 'User/userList');//检测用户列表
    Route::post('editUser', 'User/editUser');//查询单个用户数据
    Route::post('addUser', 'User/update');//添加用户
    Route::post('updateUser', 'User/update');//修改用户
    Route::post('deleteUser', 'User/update');//删除用户

    Route::post('instrumentList', 'Instrument/index');//检测仪器列表
    Route::post('findInstrument', 'Instrument/edit');//查询单个仪器
    Route::post('addInstrument', 'Instrument/update');//添加仪器
    Route::post('updateInstrument', 'Instrument/update');//编辑仪器
    Route::post('deleteInstrument', 'Instrument/update');//删除仪器

    Route::post('orderList', 'Order/index');//检测工单列表
    Route::post('findOrder', 'Order/edit');//查询工单仪器
    Route::post('addOrder', 'Order/add');//添加工单
    Route::post('updateOrder', 'Order/update');//编辑工单
    Route::post('deleteOrder', 'Order/delete');//删除工单
    Route::post('orderDetail', 'Order/detail');//工单详情
    Route::post('orderAttr', 'Order/orderAttr'); // 工单属性
    Route::post('orderProject', 'Order/orderProject'); // 工单检测项目

    Route::post('detectionList', 'Detection/index');//检测数据列表
    Route::post('getGd', 'Detection/getGd'); // 图形统计
    Route::post('reportList', 'Report/index');//检测报告列表
    Route::post('deleteReport', 'Report/delete');//删除报告

})->prefix('admin/')->allowCrossDomain();

Route::group([], function () {
    Route::post('index/register', 'User/register');//用户注册
    Route::post('index/login', 'User/login');//用户登录
    Route::post('index/getPwd', 'User/getPwd');//找回密码
    Route::post('index/sendCode', 'User/sendCode');//发送验证码
})->allowCrossDomain();


Route::group('index', function (){
    Route::post('addCharge', 'Charging/add');//添加充电桩
    Route::post('chargeInfo', 'Charging/chargeInfo');//查询充电桩

    Route::post('project', 'Project/index');//查询检测项目

    Route::post('addOrder', 'Order/add');//添加工单
    Route::post('updateStatus', 'Order/updateStatus');//接受、取消工单
    Route::post('orderList', 'Order/orderList');//工单列表
    Route::post('uploadOrderData', 'Order/uploadData');//上传工单数据

    Route::post('uploadDetectionData', 'Detection/uploadData');//上传检测数据
    Route::post('detectionData', 'Detection/detectionData');//获取检测数据

    Route::post('instrument', 'Instrument/index');//查询检测仪器
    Route::post('instrument_add', 'Instrument/create'); // 创建检测仪器

    Route::post('report', 'Report/index');//查询检测报告
    Route::post('uploadReport', 'Report/uploadReport');//上传检测报告
    Route::post('downloadReport', 'Report/downloadReport');//下载检测报告

    /* JWT token */
    Route::post('createToken', 'Index/createToken');
    Route::post('test', 'Index/test');
})->prefix('index/')->middleware('verifyToken')->allowCrossDomain();



